<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<img src="" alt="" id="img">
<input type="file" id="file">
<script src="./static/assets/jquery/jquery.min.js"></script>
<script>
    $(function () {
        $("#file").on("change", function () {
            var file = this.files[0];
            console.log(file);
            var reader = new FileReader();
            reader.readAsDataURL(file);
            reader.onload= function () {
                $("#img")[0].src=reader.result;
            }
        })
    })
</script>
</body>
</html>